package com.base.util;

import java.util.HashMap;

public class MySessionMap {
	private static MySessionMap instance = null;
	private static HashMap mymap = null;

	private MySessionMap() {
		mymap = new HashMap();
	}

	private static synchronized void init() {
		if (instance == null) {
			instance = new MySessionMap();
		}
	}

	public static MySessionMap getInstance() {
		if (instance == null) {
			init();
		}
		return instance;
	}

	public void SetCache(String key, Object value) {
		if (value != null && key != null) {
			mymap.put(key, value);
		}
	}

	public void DelCache(String key) {
		if (key != null) {
			mymap.remove(key);
		}
	}

	public Object getCache(String key) {
		if (key == null) {
			return null;
		}
		return mymap.get(key);
	}
}
